using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Flan.Controls;

public partial class WebUserControl : System.Web.UI.UserControl {
    protected void Page_Load(object sender, EventArgs e) {
        System.Threading.Thread.Sleep(200);
        UpdatePanelPopupExtender.RegisterCloseControl(divClose, UpdatePanel2);
}

    protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e) {
        if (e.CommandName != "Select") {
            UpdatePanel1.Update();
        }
        else {
            Wizard1.ActiveStepIndex = 0;

            Control c = e.CommandSource as Control;
            if (c != null) {
                //Calling UpdatePanelPopupExtender1.ShowAt(c) does the same thing
                //as the two lines below
                UpdatePanelPopupExtender1.PositionControlClientID = c.ClientID;
                UpdatePanelPopupExtender1.Show();
            }
        }
    }
    protected void DetailsView1_ItemUpdated(object sender, DetailsViewUpdatedEventArgs e) {
        GridView1.DataBind();
        UpdatePanel1.Update();
    }
    protected void UpdatePanelPopupExtender1_Close(object sender, EventArgs e) {
        GridView1.SelectedIndex = -1;
        Wizard1.ActiveStepIndex = 0;
    }
}
